    <div id="maincontent">
        <div id="wrapper-slider">
            <div id="slider" class="nivoSlider">
                <img src="<?php echo base_url('assets/slider_images/image1.jpg'); ?>" data-thumb="<?php echo base_url('assets/slider_images/image1.jpg'); ?>"  />
                <a href="#"><img src="<?php echo base_url('assets/slider_images/image2.jpg'); ?>" data-thumb="<?php echo base_url('assets/slider_images/image2.jpg'); ?>"  /></a>
                <img src="<?php echo base_url('assets/slider_images/image3.jpg'); ?>" data-thumb="<?php echo base_url('assets/slider_images/image3.jpg'); ?>"  />
                <img src="<?php echo base_url('assets/slider_images/image4.jpg'); ?>" data-thumb="<?php echo base_url('assets/slider_images/image4.jpg'); ?>"  />
            </div>
        </div><!--end nivoSlider-->
        <?php foreach($products as $product) : ?>
            <div class="sanpham">
                <a href="<?php echo site_url('product/'.$product->product_url);?>">
                    <img src="<?php echo base_url('assets/product_images/product/'.$product->product_image);?> " />
                </a>
                <a class="mua" href="<?php echo site_url('cart/add_cart/' . $product->product_id); ?>">Add Cart</a>
                <h2 class="gia">Gia <?php echo $product->product_price; ?></h2>
                <h2 class="ten"> <a href="<?php echo site_url('product/'.$product->product_url);?>"><?php echo $product->product_name;?></a></h2>
            </div>
        <?php endforeach; ?>
        <?php echo $this->pagination->create_links();?>
    </div><!--end maincontent-->
</div><!--end warper-->

    <script type="text/javascript" src="<?php echo base_url('assets/scripts/jquery-1.7.1.min.js');?>"></script>
    <script type="text/javascript" src="<?php echo base_url('assets/js/jquery.nivo.slider.pack.js');?>"></script>
    <script type="text/javascript">
        $(window).load(function() {
            $('#slider').nivoSlider();

        });
        //back to top
        $(document).ready(function() {
            $('#maincontent').append('<div id="top">Back to Top</div>');
            $(window).scroll(function() {//bat su kien
            if($(window).scrollTop() != 0) {//xac dinh vi tri trong windown
                $('#top').fadeIn();
            } else {
                $('#top').fadeOut();
            }
            });
            $('#top').click(function() {
            $('html, body').animate({scrollTop:0},500);//dua ve dau the html
           });
        });
    </script>
